import Vue from "vue"
import App from "./App.vue"
// 引入路由组件
import router from "./router/index"
// 引入store组件
import store from "./store/index"
// 引入全局组件
import TypeNav from "./components/TypeNav/index.vue"
// 引入模拟接口,起动mock服务器
import "./mock/mockServe"
// 引入swiper的css样式
import "swiper/css/swiper.min.css"
// 定义全局组件分页器
import Pagination from "@/components/Pagination"
// Dialog弹窗组件
import Dialog from "@/components/Dialog"
// 全局引入elementui
// import ElementUI from "element-ui"
// import "element-ui/lib/theme-chalk/index.css"
// Vue.use(ElementUI)

// 按需引入elementui
import { Button, Message } from "element-ui"
Vue.component(Button.name, Button)
Vue.component(Message.name, Message)

Vue.config.productionTip = false

// 注册成全局组件
Vue.component(TypeNav.name, TypeNav)
// 将分页器注册为全局组件
Vue.component(Pagination.name, Pagination)
// 将弹窗注册为全局组件'
Vue.component(Dialog.name, Dialog)

new Vue({
  beforeCreate() {
    Vue.prototype.$bus = this
  },
  render: (h) => h(App),
  router,
  store,
}).$mount("#app")
